
	/************************************************************************************************
	 	
		Factory: jsl.Boolean
		
		Methods:
			obj		Boolean		(b)		- sid: 3.0												
			b			isTrue		()		-	sid: 3.0						
			b			isFalse		()		- sid: 3.0
						
	************************************************************************************************/
	
  //-------------------------------------------------------------------------------
  jsl.Boolean = function(b) {
  	try {  		
  		var proto, rv
  		//@d[
	    if(arguments.length > 1)					throw jsl.ParamError()
			if(arguments.length && b == null)	throw jsl.ParamError("NullValue:b")//@d]
			
			if(arguments.length) {		
				
				if(b instanceof Boolean)
					if(b.__augmented) return b
					else							rv = b
				else
					rv = new Boolean(b)
			}
			else
				rv = new Boolean
													    			 	    	    
			proto = jsl.Boolean.prototype
			
    	for(var id in proto)
    		if(proto.hasOwnProperty(id))
					rv[id] = proto[id]

			rv.__native = arguments.callee.__native						
			return rv
		}
		catch(e) {
			jsl.throwError(e, this, arguments)
		}
  }
  //-------------------------------------------------------------------------------
	jsl.Boolean.__name		= "jsl.Boolean" 
  //-------------------------------------------------------------------------------
	jsl.Boolean.prototype	= jsl.Object()
  //-------------------------------------------------------------------------------
  jsl.Boolean.prototype.isTrue = function() {
    try {//@d[
      if(arguments.length)			throw jsl.ParamError()
      if(!jsl.isBoolean(this))	throw jsl.TypeError("BadMethodCall:Boolean")//@d]
			
      return !!+this 
    }
    catch(e) {
      jsl.throwError(e, this, arguments)
    }
  }
  //-------------------------------------------------------------------------------
  jsl.Boolean.prototype.isFalse = function() {
    try {//@d[
      if(arguments.length)			throw jsl.ParamError()
      if(!jsl.isBoolean(this))	throw jsl.TypeError("BadMethodCall:Boolean")//@d]
      
      return !+this 
    }
    catch(e) {
      jsl.throwError(e, this, arguments)
    }
  }
	//Boolean init
	//-------------------------------------------------------------------------------
	;(function() {
		
		var proto
				
		//-------------------------------------------------------------------------------
		jsl.Boolean.__native	= jsl.Object.__native.copy().merge(jsl.Boolean.prototype)
		proto 								= jsl.Boolean.prototype
		
		for(var id in proto) 
			if(proto.hasOwnProperty(id))
				//!proto[id].__name: if the name was already assigned, the method does not be assigned as static
				//because it is a static method of another object
				if(id.charAt(0) !== "_" && jsl.isFunction(proto[id]) && !proto[id].__name) {
					
					jsl.Boolean[id] = function(obj) { 
						try {//@d[
							if(!arguments.length)	throw jsl.ParamError() 
							if(obj === null)			throw jsl.ParamError("NullValue:obj")//@d]
							
							return arguments.callee.__f.apply(obj, Array.prototype.slice.call(arguments, 1)) 
						}
						catch(e) {
							jsl.throwError(e, this, arguments)
						}
					}
						
					jsl.Boolean[id].__name	= id
					jsl.Boolean[id].__f			= proto[id]
					proto[id].__name 				= id
				}									
	})()
  